package com.ea.admin.mapper;

import com.ea.admin.pojo.po.CompanyInfo;
import com.ea.common.mybatis.EmoAnalyBaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CompanyInfoMapper extends EmoAnalyBaseMapper<CompanyInfo> {
    List<Long> getAllCompanyId();

    List<Long> getAllSubCompanyIdByCompanyId(
            @Param("companyIdList") List<Long> companyIdList
    );

    void deleteRelatedCompanyByCompanyId(
            @Param("companyIdList") List<Long> companyIdList
    );

    /**
     * 根据公司id查询公司信息，包括被删除的公司
     */
    CompanyInfo selectCompanyInfoById(
            @Param("companyId") Long companyId
    );

    boolean checkIfCompanyHasUser(
            @Param("companyIdList") List<Long> allRelatedCompanyIdList
    );

    boolean checkIfCompanyHasAdmin(
            @Param("companyIdList") List<Long> allRelatedCompanyIdList
    );
}
